<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        // 一元加操作符
        let s1 = "01";
        let s11 = +s1;
        console.log(s11);//1

        let s2 = "1.2";
        let s22 = +s2;
        console.log(s22);//1.2

        let s3 = "a";
        let s33 = +s3;
        console.log(s33);//NaN

        let obj = {
            valueOf: function () {
                return -1;
            }
        };
        let objj = +obj;
        console.log(objj);//-1
    </script>

</head>
<body>

</body>
</html>